<#assign ctx=request.contextPath/>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>购物车</title>
		<link rel="stylesheet" href="${ctx}/css/bootstrap.css" />
		<link rel="stylesheet" href="${ctx}/css/common.css" />
		<link rel="stylesheet" href="${ctx}/css/shop_cart.css" />
		<script type="text/javascript" src="${ctx}/js/jquery-1.11.0.js" ></script>
		<script type="text/javascript" src="${ctx}/js/bootstrap.js" ></script>
		<script type="text/javascript" src="${ctx}/js/localStorge.js"></script>
		<script type="text/javascript" src="${ctx}/js/myjs.js"></script>
		
	<style type="text/css">
		.shop_tbody li{
			float: left;
			font-size: 16px;	
			width: 145px;	
		}
	
		.clear{
			clear: both;
		}
	</style>	
		
	</head>
<body style="background:#f0f0f0;">
		<#include "common/top.html"/>
			<article class="center">
			    <div class="car_top">
			    	<h3>我的购物车</h3>
			    </div>
			    <div class="all_shop">
			    	<span>全部商品(10)</span>
			    	<p>配送至：<select name="" id="">
							<option value="">广州市番禺区</option>			
							<option value="">广州市白云区</option>			
							<option value="">广州市越秀区</option>			
							<option value="">广州市天河区</option>			
							<option value="">深圳市龙岗区</option>			
						</select>
						<i></i>
					</p>
				</div>
				<div class="shop_thead">
					<ul>
						<li><a href="javaScript:void(0)" class="all_tick"><label><input type="checkbox" id="checkbox"/><span class="all_tick">全选</span></label></a></li>
						<li>商品信息</li>
						<li>单价</li>
						<li>数量</li>
						<li>金额</li>
						<li>操作</li>
					</ul>
				</div>
					<#if goodsList??>
						<#list goodsList as goods>
							<ul class="shop_tbody">
									<li  style="width: 200px;" ><input class="goodSelect" value="${goods.id!''}" type="checkbox" style="margin-left: 30px;"/>
									<img style="width: 120px;height: 100px;display: inline-block;margin-left: 10px;" alt="" src="${ctx}/file/upload/${goods.image!''}">
									</li>								
									<li style="width: 515px;">${goods.title!''}</li>
									<li >${goods.price?c}</li>
									<li style="width: 120px;">${goods.buyNum!''}</li>
									<li style="width: 130px;">${(goods.buyNum*goods.price)?c}</li>
									<li style="width: 50px;"><a href="javaScript:void(0);" >删除</a></li>												
								<div class="clear" ></div>
							</ul>
						</#list>
					<#else>
					<p style="font-size: 20px;color: red;" >你的购物车为空，<a style="color: blue;" href="${ctx}/customer/goods/goodsList">点击</a>添加商品</p>	
					</#if>

				<div class="shop_tfoot">
					<ul>
						<li><a href="javaScript:void(0)" class="all_tick"><label><input type="checkbox" id="checkbox2"/><span>全选</span></label></a></li>
						<li><a href="#" id="del_sel" onclick="show_confirm()">删除</a></li>
						<li><a href="#">分享</a></li>
						<li>已选<em id="count">0</em>商品</li>
						<#if total?? >
							<li>总价：<span id="total">${total?c}</span></li>	
						<#else>
							<li>总价：<span id="total">0</span></li>													
						</#if>
						
						<li><input id="account" type="button" value="去结算"/></li>						
					</ul>
					<script type="text/javascript">
						$(function(){
							$("#account").click(function(){
								
								var total = $("#total").text();
								var boxs = $("input[class='goodSelect']:checked");
								
								if(boxs.length>0){
									var ids = new Array();
									$.each(boxs, function(index){									  
											ids[index] = $(this).val();									  
										});
									window.location.href = "${ctx}/customer/order/toOrderSubmit?ids="+ids+"&total="+total;									
								}else{
									alert("请至少选择一项");
								}
							});
						});
					</script>
				<div class="page clear">
					<ul>
						<li><a href="#">上一页</a></li>
						<li><a href="#" class="on">1</a></li>
						<li><a href="#">2</a></li>
						<li><a href="#">3</a></li>
						<li><a href="#">4</a></li>
						<li><a href="#">5</a></li>
						<li><a href="#">...</a></li>
						<li><a href="#">下一页</a></li>
					</ul>
				</div>
			</article>
		<#include "common/bottom.html"/>
</header>
</body>



